#!/bin/bash
# - group
# - test
# - atomic_test
# - nr_threads
# - iterations
## The kernel contains a set of "self tests" under the tools/testing/selftests/
## directory. These are intended to be small unit tests to exercise individual
## code paths in the kernel.
## See: https://www.kernel.org/doc/Documentation/kselftest.txt

. $LKP_SRC/lib/tests/kernel-selftests.sh
. $LKP_SRC/lib/tests/kernel-selftests-make.sh

shopt -s nullglob

prepare_tests
run_tests $selftest_mfs

[ "$(file -i $TMP_RESULT_ROOT/kernel-selftests | awk '{print $2}')" = "application/octet-stream;" ] && {
	mv $TMP_RESULT_ROOT/kernel-selftests $TMP_RESULT_ROOT/kernel-selftests.orig
	cat $TMP_RESULT_ROOT/kernel-selftests.orig | tr -d '\0' > $TMP_RESULT_ROOT/kernel-selftests
}

exit 0
